var express = require('express');
var router = express.Router();
var connection = require('../db/sql.js')
var user = require('../db/UserSql.js');
const jwt = require('jsonwebtoken');
router.all('*', function (req, res, next) {
  res.header('Access-Control-Allow-Origin', '*');
	//Access-Control-Allow-Headers ,可根据浏览器的F12查看,把对应的粘贴在这里就行
  res.header('Access-Control-Allow-Headers', 'Content-Type');
  res.header('Access-Control-Allow-Methods', '*');
  res.header('Content-Type', 'application/json;charset=utf-8');
  next();
});
/* GET home page. */
router.get('/', function(req, res, next) {
	res.render('index', {
		title: 'Express'
	});
});
//获取当前用户订单列表
router.post('/api/selectOrder', function(req, res, next) {
	let token = req.headers.token;
	let phone = jwt.decode(token);
	connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
		//当前用户id
		let userId = results[0].id;
		connection.query(`select * from store_order where uId = ${userId}`, function (err, result) {
			res.json({
				data:result
			})
		})
	})
})
//修改订单状态
router.post('/api/submitOrder', function(req, res, next) {
    let token = req.headers.token;
    let phone = jwt.decode(token);
    //订单号
    let orderId = req.body.orderId;
    //购物车中选中的商品
    let shopArr = req.body.shopArr;
    connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
    	//当前用户id
    	let userId = results[0].id;
        connection.query(`select * from store_order where uId = ${userId} and order_id = ${orderId}`,function(err,result){
            //订单的id
            let id = result[0].id;
                connection.query(`update store_order set order_status = replace(order_status,'1','2') where id = ${id}`,function(){
                    shopArr.forEach(v=>{
                        connection.query(`delete from goods_cart where id = ${v}`,function(){
                            
                        })
                    })
                    res.send({
                        data:{
                            code:200,
                            success:true
                        }
                    })
             })
        })
    })
})

//生成订单
router.post('/api/addOrder', function(req, res, next) {
    let token = req.headers.token;
    let phone = jwt.decode(token);
    //前端给后端传递的数据
    let goodsArr = req.body.arr;
    //生成订单号
    function setTimeDateFmt( s ){
        return s < 10 ? '0' + s : s;
    }
    function orderNumber(){
        const now = new Date();
        let fullYear = now.getFullYear();
        let month = setTimeDateFmt( now.getMonth() + 1 );
        let day = setTimeDateFmt( now.getDate() );
        let hour = setTimeDateFmt( now.getHours() );
        let minutes = setTimeDateFmt( now.getMinutes() );
        let seconds = setTimeDateFmt( now.getSeconds() );
        let orderCode = fullYear + month + day + hour + minutes + seconds + ( Math.round( Math.random() * 1000000 ));
        return orderCode;
    }
    //商品名称
    let goodsName = [];
    //订单总价
    let goodsPrice = 0;
    //订单商品总数量
    let goodsNum = 0;
		 //订单图片
		let goodsUrl = [];
    //订单号
    let orderId = orderNumber();
    goodsArr.forEach(v=>{
        goodsName.push(  v.name );
        goodsNum += parseInt(v.num);
        goodsPrice +=  v.num * v.pprice;
				goodsUrl.push( v.imgUrl );
    })
    connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
    	//当前用户id
    	let userId = results[0].id;
        connection.query(`insert into store_order (uId,order_id,goods_name,goods_price,goods_url,goods_num,order_status) values ('${userId}','${orderId}','${goodsName}','${goodsPrice}','${goodsUrl}','${goodsNum}','1')`,function(){
            connection.query(`select * from store_order where uId = ${userId} and order_id = ${orderId}`,function(err,result){
                res.send({
                    data:{
                        code:200,
                        success:true,
                        data:result
                    }
                })
            })
        })
    })
})
//删除购物车商品数据
router.post('/api/deleteCart', function(req, res, next) {
	let goodsId = req.body.goodsId;
	for(var i=0;i<goodsId.length;i++){
		connection.query(`delete from goods_cart where id=${goodsId[i]}`,function(e,r){
			res.json({
				data:{
					success:true
				}
			})
		})
	}
})
//加入购物车
router.post('/api/addCart', function(req, res, next) {
	let token = req.headers.token;
	let phone = jwt.decode(token);
	//商品id
	let goods_id = req.body.goods_id;
	//用户输入的商品数量
	let num = req.body.num;
	connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
		//当前用户id
		let userId = results[0].id;
		connection.query(`select * from goods_search where id = ${goods_id}`, function (err, result) {
			let name = result[0].name;
			let imgUrl = result[0].imgUrl;
			let pprice = result[0].pprice;
			//查询当前用户之前是否添加过这个商品
			connection.query(`select * from goods_cart where uId = ${userId} and goods_id = ${goods_id}`, function (err, data) {
				if( data.length > 0){
					//如果当前用户已经添加过本商品,就让数量增加
					connection.query(`update goods_cart set num = replace(num,${data[0].num},${ parseInt(num) + parseInt(data[0].num) }) where id = ${data[0].id}`, function (e, r) {
						res.json({
							data:{
								success:"加入成功"
							}
						})
					})
				}else{
					//如果当前用户之前没有加入过本商品,需要添加进入
					connection.query('insert into goods_cart (uId,goods_id,name,imgUrl,pprice,num) values ("'+userId+'","'+goods_id+'","'+name+'","'+imgUrl+'","'+pprice+'","'+num+'")', function (err, data) {
						res.json({
							data:{
								success:"加入成功"
							}
						})
					})
				}
			})
		})
	})
})
//修改当前用户购物车商品数量
router.post('/api/updateNumCart', function(req, res, next) {
	let token = req.headers.token;
	let phone = jwt.decode(token);
	//商品id
	let goodsId = req.body.goodsId;
	//用户输入的商品数量
	let num = req.body.num;
	connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
		//当前用户id
		let userId = results[0].id;
		connection.query(`select * from goods_cart where uId = ${userId} and goods_id = ${goodsId}`, function (err, result) {
			//数据中当前的数量
			let goods_num = result[0].num;
			//当前的id号
			let id = result[0].id;
			//修改[替换]
			connection.query(`update goods_cart set num = replace(num,${goods_num},${num}) where id = ${id}`, function (e, r) {
				res.json({
					data:{
						success:true
					}
				})
			})
		})
	})
})
//获取当前用户购物车列表
router.post('/api/selectCart', function(req, res, next) {
	let token = req.headers.token;
	let phone = jwt.decode(token);
	connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
		//当前用户id
		let userId = results[0].id;
		connection.query(`select * from goods_cart where uId = ${userId}`, function (err, result) {
			res.json({
				data:result
			})
		})
	})
})
//当前用户修改收货地址
router.post('/api/updateAddress', function(req, res, next) {
	let token = req.headers.token;
	let phone = jwt.decode(token);
	let name = req.body.name;
	let tel = req.body.tel;
	let province = req.body.province;
	let city = req.body.city;
	let district = req.body.district;
	let address = req.body.address;
	let isDefault = req.body.isDefault;
	let id = req.body.id;
	
	//获取userId
	connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
		let userId = results[0].id;
		connection.query(`select * from address where userId = ${userId} and isDefault = ${isDefault}`, function (err, result) {
			let childId = result[0].id;
			connection.query(`update address set isDefault = replace(isDefault,"1","0") where id = ${childId}`, function (e, r) {
				let updateSql = `update address set name = ?,tel = ?,province = ?,city = ?,district = ?,address = ?,isDefault = ?,userId = ? where id = ${id}`
				connection.query(updateSql,[name,tel,province,city,district,address,isDefault,userId],function (err, result) {
					res.send({
						data:{
							success:'成功'
						}
					})
				})
			})
		})
	})
})

//当前用户新增收货地址
router.post('/api/addAddress', function(req, res, next) {
	let token = req.headers.token;
	let phone = jwt.decode(token);
	let name = req.body.name;
	let tel = req.body.tel;
	let province = req.body.province;
	let city = req.body.city;
	let district = req.body.district;
	let address = req.body.address;
	let isDefault = req.body.isDefault;
	connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
		let id = results[0].id;
		let sqlInert = 'insert into address (name,tel,province,city,district,address,isDefault,userId) values ("'+name+'","'+tel+'","'+province+'","'+city+'","'+district+'","'+address+'","'+isDefault+'","'+id+'")';
		connection.query(sqlInert, function (err, result, field) {
			res.send({
				data:{
					success:"成功"
				}
			})
		})
	})
})
//当前用户查询收货地址
router.post('/api/selectAddress', function(req, res, next) {
	let token = req.headers.token;
	let phone = jwt.decode(token);
	connection.query(`select * from user where phone = ${phone.name}`, function (error, results, fields) {
		let id = results[0].id;
		connection.query(`select * from address where userid = ${id}`, function (err, result, field) {
			res.send({
				data:result
			})
		})
	})
})
// 根据id搜索商品
router.get('/api/goods/id', function(req, res, next) {
	let id = req.query.id;
	connection.query("select * from goods_search where id=" + id + "", function(error, results, fields) {
		if (error) throw error;
		res.send({
			code: "0",
			data: results
		})
	});
});

//注册验证手机号是否存在
router.post('/api/registered', function(req, res, next) {
	
	//前端给后端的数据
	let params = {
		userName : req.body.userName
	};
	//查询手机号是否存在
	connection.query( user.queryUserName( params ) , function (error, results, fields) {
		if( results.length > 0 ){
			res.send({
				data:{
					success:false,
					msg:"手机号已经存在"
				}
			})
		}else{
			res.send({
				data:{
					success:true
				}
			})
		}
	})
	
})
//注册===>增加一条数据
router.post('/api/addUser', function(req, res, next) {
	//前端给后端的数据
	let params = {
		userName  : req.body.userName ,
		userPwd : req.body.userPwd
	};
	connection.query( user.insertData( params ) , function (error, results, fields) {
			res.send({
			data:{
				success:true,
				msg:"注册成功"
			}
		})
	})
})
//用户登录
router.post('/api/login', function(req, res, next) {
	
	//前端给后端的数据
	let params = {
		userName : req.body.userName,
		userPwd  : req.body.userPwd
	}
	//查询用户名或者手机号存在不存在
	 connection.query( user.queryUserName( params ) , function (error, results, fields) {
		if( results.length > 0 ){
			 connection.query( user.queryUserPwd( params ) , function (err, result) {
				 if(  result.length > 0 ){
					 res.send({
					 	data:{
					 		success:true,
					 		msg:"登录成功",
							data:result[0]
					 	}
					 })
				 }else{
					 res.send({
						data:{
							success:false,
							msg:"密码不正确"
						}
					 })
				 }
			 })
		}else{
			res.send({
				data:{
					success:false,
					msg:"用户名或手机号不存在"
				}
			})
		}
	 })
});

// 商品列表
router.get('/api/goods/list', function(req, res, next) {
	res.json({
		code: 0,
		data: [{
				id: 1,
				name: "电子产品",
				data: [{
						name: "手机",
						list: [{
								id: 1,
								name: "苹果",
								imgUrl: "../../static/img/recommend/sj.jpg"
							},
							{
								id: 2,
								name: "华为",
								imgUrl: "../../static/img/recommend/sj.jpg"
							},
							{
								id: 3,
								name: "小米",
								imgUrl: "../../static/img/recommend/sj.jpg"
							},
							{
								id: 4,
								name: "三星",
								imgUrl: "../../static/img/recommend/sj.jpg"
							}
						]
					},
					{
						name: "电脑",
						list: [{
								id: 1,
								name: "外星人",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 2,
								name: "拯救者",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 3,
								name: "英特尔",
								imgUrl: "../../static/img/recommend/dn.jpg"
							}
						]
					},
					{
						name: "游戏机",
						list: [{
								id: 1,
								name: "掌上游戏机",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "小霸王",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 3,
								name: "水果机",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					},
					{
						name: "平板电脑",
						list: [{
								id: 1,
								name: "苹果iPad",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "华为MateP",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 3,
								name: "小米平板",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					},
					{
						name: "智能手表",
						list: [{
								id: 1,
								name: "儿童手表",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "运动手表",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 3,
								name: "户外手表",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			},
			{
				id: 2,
				name: "洗护",
				data: [{
						name: "牙膏",
						list: [{
								id: 1,
								name: "美白",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 2,
								name: "清洗口腔",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 3,
								name: "牙龈护理",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 4,
								name: "儿童",
								imgUrl: "../../static/img/recommend/yg.jpg"
							}
						]
					},
					{
						name: "洗发",
						list: [{
								id: 1,
								name: "洗发水",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 2,
								name: "洗发梳",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 3,
								name: "护发素",
								imgUrl: "../../static/img/recommend/dn.jpg"
							}
						]
					},
					{
						name: "镜子",
						list: [{
								id: 1,
								name: "随身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "全身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 3,
								name: "化妆镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			},
			{
				id: 3,
				name: "箱包",
				data: [{
						name: "旅行箱",
						list: [{
								id: 1,
								name: "美白",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 2,
								name: "清洗口腔",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 3,
								name: "牙龈护理",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 4,
								name: "儿童",
								imgUrl: "../../static/img/recommend/yg.jpg"
							}
						]
					},
					{
						name: "男士挎包",
						list: [{
								id: 1,
								name: "洗发水",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 2,
								name: "洗发梳",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 3,
								name: "护发素",
								imgUrl: "../../static/img/recommend/dn.jpg"
							}
						]
					},
					{
						name: "单肩包",
						list: [{
								id: 1,
								name: "随身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "全身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 3,
								name: "化妆镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			},
			{
				id: 4,
				name: "母婴",
				data: [{
						name: "儿童套装",
						list: [{
								id: 1,
								name: "美白",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 2,
								name: "清洗口腔",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 3,
								name: "牙龈护理",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 4,
								name: "儿童",
								imgUrl: "../../static/img/recommend/yg.jpg"
							}
						]
					},
					{
						name: "孕妇装",
						list: [{
								id: 1,
								name: "洗发水",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 2,
								name: "洗发梳",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 3,
								name: "护发素",
								imgUrl: "../../static/img/recommend/dn.jpg"
							}
						]
					},
					{
						name: "儿童裤子",
						list: [{
								id: 1,
								name: "随身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "全身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 3,
								name: "化妆镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			},
			{
				id: 5,
				name: "电器",
				data: [{
						name: "牙膏",
						list: [{
								id: 1,
								name: "美白",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 2,
								name: "清洗口腔",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 3,
								name: "牙龈护理",
								imgUrl: "../../static/img/recommend/yg.jpg"
							},
							{
								id: 4,
								name: "儿童",
								imgUrl: "../../static/img/recommend/yg.jpg"
							}
						]
					},
					{
						name: "洗发",
						list: [{
								id: 1,
								name: "洗发水",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 2,
								name: "洗发梳",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 3,
								name: "护发素",
								imgUrl: "../../static/img/recommend/dn.jpg"
							}
						]
					},
					{
						name: "镜子",
						list: [{
								id: 1,
								name: "随身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "全身镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 3,
								name: "化妆镜",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			},
			{
				id: 6,
				name: "电器",
				data: [{
						name: "裙装",
						list: [{
								id: 1,
								name: "半身裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "连衣裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					},
					{
						name: "上衣",
						list: [{
								id: 1,
								name: "T恤",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "衬衫",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			},
			{
				id: 7,
				name: "女装",
				data: [{
						name: "裙装",
						list: [{
								id: 1,
								name: "半身裙",
								imgUrl: "../../static/img/recommend/sj.jpg"
							},
							{
								id: 2,
								name: "连衣裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					},
					{
						name: "上衣",
						list: [{
								id: 1,
								name: "T恤",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "衬衫",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			}, {
				id: 8,
				name: "保健",
				data: [{
						name: "裙装",
						list: [{
								id: 1,
								name: "半身裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "连衣裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					},
					{
						name: "上衣",
						list: [{
								id: 1,
								name: "T恤",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "衬衫",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			}, {
				id: 9,
				name: "生鲜",
				data: [{
						name: "裙装",
						list: [{
								id: 1,
								name: "半身裙",
								imgUrl: "../../static/img/recommend/dn.jpg"
							},
							{
								id: 2,
								name: "连衣裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					},
					{
						name: "上衣",
						list: [{
								id: 1,
								name: "T恤",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "衬衫",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			}, {
				id: 10,
				name: "医药",
				data: [{
						name: "裙装",
						list: [{
								id: 1,
								name: "半身裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "连衣裙",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					},
					{
						name: "上衣",
						list: [{
								id: 1,
								name: "T恤",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							},
							{
								id: 2,
								name: "衬衫",
								imgUrl: "../../static/img/swipers/swiper3.jpg"
							}
						]
					}
				]
			},
		]
	})
});

// 商品的搜索
router.get("/api/goods/search", function(req, res, next) {
	//desc降序     asc升序
	//获取对象的key
	let [goodsName, orderName] = Object.keys(req.query);
	//name参数的值
	let name = req.query.name;
	//orderName的key的值
	let order = req.query[orderName];
	connection.query("select * from goods_search where name like '%"+name+"%' order by "+orderName+" "+order+"", function (error, results, fields) {
		  if (error) throw error;
		  res.send({
			  code:"0",
			  data:results
			})
		});

});
// 首页推荐数据接口
router.get("/api/index_list/data", function(req, res, next) {
	res.send({
		"code": 0,
		"data": {
			topBar: [{
					id: 1,
					name: '推荐'
				},
				{
					id: 2,
					name: '手机'
				},
				{
					id: 3,
					name: '鞋子'
				},
				{
					id: 4,
					name: '女装'
				},
				{
					id: 5,
					name: '箱包'
				},
				{
					id: 6,
					name: '珠宝'
				},
				{
					id: 7,
					name: '食品'
				}
			],
			data: [{
					type: "swiperList",
					data: [{
							imgUrl: '../../static/img/swipers/swiper1.jpg'
						},
						{
							imgUrl: '../../static/img/swipers/swiper2.jpg'
						},
						{
							imgUrl: '../../static/img/swipers/swiper3.jpg'
						}
					]
				},
				{
					type: "recommendList",
					data: [{
						bigUrl: "../../static/img/recommend/recommends.jpg",
						data: [{
								imgUrl: "../../static/img/recommend/recommend1.jpg"
							},
							{
								imgUrl: "../../static/img/recommend/recommend2.jpg"
							},
							{
								imgUrl: "../../static/img/recommend/recommend3.jpg"
							}
						]
					}, ]
				},
				{
					type: "commodityList",
					data: [{
							id: 1,
							imgUrl: "../../static/img/commodityList/commodityList1.jpg",
							name: "2023爆款包包，疯狂GG008",
							pprice: "299",
							oprice: "659",
							discount: "5.2"
						},
						{
							id: 2,
							imgUrl: "../../static/img/commodityList/commodityList2.jpg",
							name: "新款连衣裙2023，韩版大款",
							pprice: "299",
							oprice: "659",
							discount: "5.2"
						},
						{
							id: 3,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/f7b00632cfd9887b.jpg",
							name: "彻底摆脱脚臭，灌装瓶",
							pprice: "50",
							oprice: "85",
							discount: "6.2"
						},
						{
							id: 4,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/4241314d773a1c3c.jpg",
							name: "薰衣草味的洗衣粉",
							pprice: "67",
							oprice: "72",
							discount: "9"
						},{
							id: 5,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/50c28dd60eadde6e.jpg",
							name: "化妆台上必备化妆镜",
							pprice: "9.9",
							oprice: "20",
							discount: "5"
						},
						{
							id: 6,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/b351ec5cb9787418.jpg",
							name: "苹果13上线了，快来订购吧",
							pprice: "4399",
							oprice: "5800",
							discount: "8"
						}
					]
				}
			]
		}
	})
});
// 首页推荐第一次触底数据接口
router.get("/api/index_list/1/data/2", function(req, res, next) {
	res.json({
		code: '0',
		data: [{
			type: "commodityList",
			data: [{
							id: 1,
							imgUrl: "../../static/img/commodityList/commodityList1.jpg",
							name: "2023爆款包包，疯狂GG008",
							pprice: "299",
							oprice: "659",
							discount: "5.2"
						},
						{
							id: 2,
							imgUrl: "../../static/img/commodityList/commodityList2.jpg",
							name: "新款连衣裙2023，韩版大款",
							pprice: "299",
							oprice: "659",
							discount: "5.2"
						},
						{
							id: 3,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/f7b00632cfd9887b.jpg",
							name: "彻底摆脱脚臭，灌装瓶",
							pprice: "50",
							oprice: "85",
							discount: "6.2"
						},
						{
							id: 4,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/4241314d773a1c3c.jpg",
							name: "薰衣草味的洗衣粉",
							pprice: "67",
							oprice: "72",
							discount: "9"
						},{
							id: 5,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/50c28dd60eadde6e.jpg",
							name: "化妆台上必备化妆镜",
							pprice: "9.9",
							oprice: "20",
							discount: "5"
						},
						{
							id: 6,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/b351ec5cb9787418.jpg",
							name: "苹果13上线了，快来订购吧",
							pprice: "4399",
							oprice: "5800",
							discount: "8"
						},
						{
							id: 3,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/f7b00632cfd9887b.jpg",
							name: "彻底摆脱脚臭，灌装瓶",
							pprice: "50",
							oprice: "85",
							discount: "6.2"
						},
						{
							id: 7,
							imgUrl: "https://tuchuangs.com/imgs/2023/04/13/31c0bcf092084642.jpg",
							name: "华为Mate40手机，为你展示",
							pprice: "4577",
							oprice: "5844",
							discount: "8"
						}
			]
		}]
	})
})
// 首页手机数据接口
router.get('/api/index_list/2/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/swipers/swiper1.jpg",
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "华为"
					},
					{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "苹果"
					},
					{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "小米"
					},
					{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "三星"
					},
					{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "VIVO"
					},
					{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "OPPO"
					},
					{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "荣耀"
					},
					{
						imgUrl: "../../static/img/recommend/sj.jpg",
						name: "洛基亚"
					},
				],
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: '../../static/img/recommend/recommend1.jpg',
						name: '2022款新手机上市，还在等什么，快点购买吧',
						oprice: '299',
						pprice: '199',
						discount: '5.9'
					},
					{
						id: 2,
						imgUrl: '../../static/img/recommend/recommend2.jpg',
						name: '2021款新手机上市，还在等什么，快点购买吧',
						oprice: '699',
						pprice: '299',
						discount: '4'
					},
					{
						id: 3,
						imgUrl: '../../static/img/recommend/recommend3.jpg',
						name: '2023款新手机上市，还在等什么，快点购买吧',
						oprice: '199',
						pprice: '299',
						discount: '5.2'
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/swipers/swiper3.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/commodityList/commodityList1.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/commodityList/commodityList2.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/commodityList/commodityList3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/commodityList/commodityList4.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					},
					{
						bigUrl: "../../static/img/swipers/swiper2.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/commodityList/commodityList3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/commodityList/commodityList1.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/commodityList/commodityList4.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/commodityList/commodityList2.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 5,
								imgUrl: '../../static/img/commodityList/commodityList2.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					}
				]
			},
			{
				type: "commodityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/commodityList/commodityList1.jpg",
						name: "2023爆款包包，疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/commodityList/commodityList2.jpg",
						name: "新款连衣裙2023，韩版大款",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/commodityList/commodityList3.jpg",
						name: "新款连衣裙2023，韩版大款，必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 4,
						imgUrl: "../../static/img/commodityList/commodityList4.jpg",
						name: "新款连衣裙2023，韩版大款,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});
// 首页手机第一次触底的数据
router.get("/api/index_list/2/data/2", function(req, res, next) {
	res.json({
		code: '0',
		data: [{
			type: "commodityList",
			data: [{
					id: 1,
					imgUrl: "../../static/img/recommend1.jpg",
					name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
					pprice: "299",
					oprice: "659",
					discount: "5.2"
				},
				{
					id: 2,
					imgUrl: "../../static/img/recommend1.jpg",
					name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
					pprice: "299",
					oprice: "659",
					discount: "5.2"
				},
				{
					id: 3,
					imgUrl: "../../static/img/recommend1.jpg",
					name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
					pprice: "299",
					oprice: "659",
					discount: "5.2"
				},
				{
					id: 4,
					imgUrl: "../../static/img/recommend1.jpg",
					name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
					pprice: "299",
					oprice: "659",
					discount: "5.2"
				}
			]
		}]
	})
})
// 首页男装数据接口
router.get('/api/index_list/3/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/swipers/swiper3.jpg",
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "男装"
					},
				],
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '299',
						pprice: '199',
						discount: '5.9'
					},
					{
						id: 2,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '699',
						pprice: '299',
						discount: '4'
					},
					{
						id: 3,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '199',
						pprice: '299',
						discount: '5.2'
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							}, {
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					},
					{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					}
				]
			},
			{
				type: "commodityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 4,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});
// 首页女装数据接口
router.get('/api/index_list/4/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/swipers/swiper3.jpg",
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "女装"
					},
				],
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '299',
						pprice: '199',
						discount: '5.9'
					},
					{
						id: 2,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '699',
						pprice: '299',
						discount: '4'
					},
					{
						id: 3,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '199',
						pprice: '299',
						discount: '5.2'
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							}, {
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					},
					{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					}
				]
			},
			{
				type: "commodityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 4,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});
// 首页箱包数据接口
router.get('/api/index_list/5/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/swipers/swiper3.jpg",
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
				],
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '299',
						pprice: '199',
						discount: '5.9'
					},
					{
						id: 2,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '699',
						pprice: '299',
						discount: '4'
					},
					{
						id: 3,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '199',
						pprice: '299',
						discount: '5.2'
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							}, {
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					},
					{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					}
				]
			},
			{
				type: "commodityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 4,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});
// 首页珠宝数据接口
router.get('/api/index_list/6/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/swipers/swiper3.jpg",
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "珠宝"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "珠宝"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "珠宝"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "珠宝"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
				],
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '299',
						pprice: '199',
						discount: '5.9'
					},
					{
						id: 2,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '699',
						pprice: '299',
						discount: '4'
					},
					{
						id: 3,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '199',
						pprice: '299',
						discount: '5.2'
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							}, {
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					},
					{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					}
				]
			},
			{
				type: "commodityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 4,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});
// 首页食品数据接口
router.get('/api/index_list/7/data/1', function(req, res, next) {
	res.json({
		code: "0",
		data: [{
				type: "bannerList",
				imgUrl: "../../static/img/swipers/swiper3.jpg",
			},
			{
				type: "iconsList",
				data: [{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "食品"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "食品"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "食品"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "食品"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "食品"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
					{
						imgUrl: "../../static/img/recommend1.jpg",
						name: "箱包"
					},
				],
			},
			{
				type: "hotList",
				data: [{
						id: 1,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '299',
						pprice: '199',
						discount: '5.9'
					},
					{
						id: 2,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '699',
						pprice: '299',
						discount: '4'
					},
					{
						id: 3,
						imgUrl: '../../static/img/swipers/swiper3.jpg',
						name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
						oprice: '199',
						pprice: '299',
						discount: '5.2'
					}
				]
			},
			{
				type: "shopList",
				data: [{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							}, {
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					},
					{
						bigUrl: "../../static/img/recommend1.jpg",
						data: [{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 1,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '299',
								pprice: '199',
								discount: '5.9'
							},
							{
								id: 2,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '699',
								pprice: '299',
								discount: '4'
							},
							{
								id: 3,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
							{
								id: 4,
								imgUrl: '../../static/img/swipers/swiper3.jpg',
								name: '我回归很胜过更 光棍节kg看目的港开关开关gsdfg 的给我个山沟',
								oprice: '199',
								pprice: '299',
								discount: '5.2'
							},
						]
					}
				]
			},
			{
				type: "commodityList",
				data: [{
						id: 1,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 2,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 3,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					},
					{
						id: 4,
						imgUrl: "../../static/img/recommend1.jpg",
						name: "大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008大姨绒毛大款2020年必须买,不买你就不行了,爆款疯狂GG008",
						pprice: "299",
						oprice: "659",
						discount: "5.2"
					}
				]
			}
		]
	})
});
module.exports = router;